package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;
import com.aiyige.base.api.service.ApiService;
import com.aiyige.model.eshop.OrderCreateModel;
import com.aiyige.trace.model.Trace;
import com.aiyige.trace.util.TraceUtil;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by xiachao 20180528
 */

public class CreateOrderRequest {


    OrderCreateModel orderCreateModel;
    String tid;
    int code;

    private CreateOrderRequest(Builder builder) {
        orderCreateModel = builder.orderCreateModel;
        tid = builder.tid;
        code = builder.code;
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public static final class Builder {
        private OrderCreateModel orderCreateModel;
        private String tid;
        private int code;

        public Builder() {
        }

        public Builder orderCreateModel(OrderCreateModel val) {
            orderCreateModel = val;
            return this;
        }

        public Builder tid(String val) {
            tid = val;
            return this;
        }

        public Builder code(int val) {
            code = val;
            return this;
        }


        public Call<ResponseBody> build() {
            return ApiManager.getService().createOrder(orderCreateModel, tid, code);
        }
    }
}
